#include "D:\MyCode\cpp-basic-practice\MultiRelationalMessageFolder\Message.h"
#include "D:\MyCode\cpp-basic-practice\MultiRelationalMessageFolder\Folder.h"

Folder::Folder(const Folder &f) : contents(f.contents), messages(f.messages) { } //拷贝构造函数
//赋值运算符
Folder& Folder::operator=(const Folder &rhs) { 
    if (this != &rhs) {
        for (auto m : messages) {
            m->folders.erase(this);
        }
        messages.clear();
        for (auto m : rhs.messages) {
            m->folders.insert(this);
            messages.insert(m);
        }
    }
    return *this;
}
//析构函数
Folder::~Folder() { } //析构函数